package com.atguigu.lease;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableScheduling//开启定时功能
@SpringBootApplication
@MapperScan("com.atguigu.lease.web.*.mapper")
@Slf4j
public class AdminWebApplication {
    //设置分页插件
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        log.info("设置分页插件");
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }

    public static void main(String[] args) {


        SpringApplication.run(AdminWebApplication.class, args);
    }


}
